package com.hy.util;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.hy.entity.User;

import java.util.ArrayList;
import java.util.List;

public class UserExcelListener extends AnalysisEventListener<User> {
    private final List<User> userList = new ArrayList<>();

    @Override
    public void invoke(User user, AnalysisContext context) {
        userList.add(user);
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext context) {
        // 可在此处添加额外操作（如日志记录）
    }

    public List<User> getUserList() {
        return userList;
    }
}
